<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Math.random() 返回介于 0（包括）与 1（不包括）之间的随机整数</title>
</head>

<body>
    <h2>JavaScript Math.random()</h2>
    <p>Math.random() 返回 0（包含）和 1（不包括）之间的随机数：</p>
    <p id="demo"></p>
    <script>
        document.getElementById("demo").innerHTML = Math.random();
    </script>
</body>

</html>